home *** CD-ROM | disk | FTP | other *** search
- # DroidWorks
- # Battery item cog
- #
- # Each battery supplies 1000 power units
- #
- # Battery is in inventory bin 16
- # Power is in inventory bin 20
-
- symbols
-
- thing player
-
- message activated
-
- sound batteryActivate=NRG00tBattUse.wav
-
- end
-
- # ========================================================================================
-
- code
-
- activated:
- print("activated");
- player = GetSourceRef();
-
- if (GetInv(player, 16) > 0)
- {
- if (GetInv(player, 20) < GetInvMax(player, 20))
- {
- print("using small battery");
-
- if (dwcheckDroidCaps(1048576)!=0) dwplayplayerspeech("", 510);
-
- PlaySoundlocal(batteryActivate, 1.0, 0.0, 0);
- ChangeInv(player, 20, 1000);
- ChangeInv(player, 16, -1);
- if(GetInv(player, 16) == 0) SetInvAvailable(player, 16, 0);
- }
- }
- return;
-
- end
-